//
//  DpCell.m
//  南京大牌档
//
//  Created by student on 13-12-25.
//  Copyright (c) 2013年 无锡第三团队. All rights reserved.
//

#import "DpCell.h"

@implementation DpCell

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self initSubview];
        self.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
    }
    return self;
}
-(void)initSubview
{
    dpImage =[[UIImageView alloc]initWithFrame:CGRectZero];
    dpImage.backgroundColor=[UIColor clearColor];
    [self.contentView addSubview:dpImage];
    dpLabel=[[UILabel alloc]initWithFrame:CGRectZero];
    dpLabel.backgroundColor=[UIColor clearColor];
    dpLabel.font=[UIFont boldSystemFontOfSize:14];
    dpLabel.numberOfLines=2;
    [self.contentView addSubview:dpLabel];
    detailLabel=[[UILabel alloc]initWithFrame:CGRectZero];
    detailLabel.backgroundColor=[UIColor clearColor];
    detailLabel.numberOfLines=4;
    detailLabel.font=[UIFont boldSystemFontOfSize:10];
    [self.contentView addSubview:detailLabel];
    
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
-(void)layoutSubviews
{
    [super layoutSubviews];
    dpImage.frame=CGRectMake(10, 10, 100, (WXHLApplicationBounds().size.height-46-60)/4-20);
    
    dpLabel.text=self.dpLabelString;
    
    dpLabel.frame=CGRectMake(dpImage.frame.size.width+20, 10, 170, dpImage.frame.size.height/5*2);
    
    
    
    detailLabel.frame=CGRectMake(dpImage.frame.size.width+20, dpLabel.frame.size.height+10, 160, dpImage.frame.size.height/5*3);
    
    [dpImage setImageWithURL:[NSURL URLWithString:self.dpImageString]];
    
    detailLabel.text=self.detailLabelString;
}

@end
